package com.conasinf.sofia.model;
// Generated 14/03/2014 05:30:19 PM by Hibernate Tools 3.6.0

import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import util.SofiaUtil;

/**
 * THorariosTurno generated by hbm2java
 */
@Entity
@Table(name = "t_horarios_turno", schema = "public"
)
public class THorariosTurno implements java.io.Serializable {

    private int id;
    private TTurnos TTurnos;
    private int diaSemana;
    private Date horaEntrada;
    private Date horaSalida;
    private String usuario;

    public THorariosTurno() {

    }

    public THorariosTurno(int id, TTurnos TTurnos, int diaSemana, Date horaEntrada, Date horaSalida, String usuario) {
        this.id = id;
        this.TTurnos = TTurnos;
        this.diaSemana = diaSemana;
        this.horaEntrada = horaEntrada;
        this.horaSalida = horaSalida;
        this.usuario = usuario;
    }

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    @Column(name = "id", unique = true, nullable = false)
    public int getId() {
        return this.id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "turno", nullable = false)
    public TTurnos getTTurnos() {
        return this.TTurnos;
    }

    public void setTTurnos(TTurnos TTurnos) {
        this.TTurnos = TTurnos;
    }

    @Column(name = "dia_semana", nullable = false)
    public int getDiaSemana() {
        return this.diaSemana;
    }

    public void setDiaSemana(int diaSemana) {
        this.diaSemana = diaSemana;
    }

    @Temporal(TemporalType.TIME)
    @Column(name = "hora_entrada", nullable = false, length = 21)
    public Date getHoraEntrada() {
        return this.horaEntrada;
    }

    public void setHoraEntrada(Date horaEntrada) {
        this.horaEntrada = horaEntrada;
    }

    @Temporal(TemporalType.TIME)
    @Column(name = "hora_salida", nullable = false, length = 21)
    public Date getHoraSalida() {
        return this.horaSalida;
    }

    public void setHoraSalida(Date horaSalida) {
        this.horaSalida = horaSalida;
    }

    @Column(name = "usuario", nullable = false)
    public String getUsuario() {
        return this.usuario;
    }

    public void setUsuario(String usuario) {
        this.usuario = usuario;
    }

    public String getNombreDia() {
        return SofiaUtil.nombreDia(this.diaSemana - 1);
    }

}
